/*
 * @Author: 橘子
 * @Date: 2021-10-08 21:30:09
 * @Project_description: 用户
 * @Description: 代码是我抄的，不会也是真的
 */

export default ({ request }) => ({
  //登录
  login(data) {
    return request({
      url: '/login',
      method: 'post',
      data,
    })
  },
  //查询单个
  find(params) {
    return request({
      url: '/user/findUserInfo',
      method: 'get',
      params,
    })
  },
  //用户角色List
  userRole(params) {
    return request({
      url: 'userRole/findUserRoleByUserId',
      method: 'get',
      params,
    })
  },
  //查询list
  list(data) {
    return request({
      url: 'user/findUserPageByCondition',
      method: 'post',
      data,
    })
  },
  //修改
  put(data) {
    return request({
      url: 'user/updateUserByCondition',
      method: 'post',
      data,
    })
  },

  //添加单个
  add(data) {
    return request({
      url: 'user/createUserInfo',
      method: 'post',
      data,
    })
  },
  adduserRole(data) {
    return request({
      url: 'userRole/saveOrUpdateRoleIds',
      method: 'post',
      data,
    })
  },

  //删除
  del(params) {
    return request({
      url: 'user/delUserById',
      method: 'get',
      params,
    })
  },
})
